package dre.sample.actions;

import java.util.ArrayList;
import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import dre.sample.beans.InformationBean;
import dre.sample.forms.InformationForm;

public class ViewSeatAction extends Action{
	

	public ActionForward execute(
		ActionMapping mapping,
		ActionForm form,
		HttpServletRequest request,
		HttpServletResponse response)
		throws Exception {
			
		String link = "success";
		InformationForm frm = (InformationForm) form;
		ArrayList ar = new ArrayList();
		for (int i=0;i<5;i++) {
			InformationBean ib = new InformationBean();
			ib.setEmployeeId("employee" +i);
			ib.setFirstName("firstname" +i);
			ib.setLastName("lastname"+i);
			
			ar.add(ib);
		}
		frm.setListVal(ar);
		frm.setFirstName("Donna");
		return mapping.findForward(link);
	}

}
